import "dotenv/config.js";

import db from "../src/database.js";
import dayjs from "dayjs";

(async () => {
  const user = await db.findOne`SELECT * FROM user where id = 1`;
  console.log(user.updatedAt, typeof user.updatedAt);
  const date = dayjs("2023-09-11 15:14:00");
  const now = dayjs();
  console.log(
    now.format("YYYY-MM-DD HH:mm:ss"),
    date.format("YYYY-MM-DD HH:mm:ss"),
    typeof date,
    date.diff(now, "hour")
  );
  await db.close();
})();
